var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function i() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, 
    new i());
}), a = this && this.__decorate || function(t, e, o, i) {
    var r, n = arguments.length, s = n < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, o, i); else for (var p = t.length - 1; 0 <= p; p--) (r = t[p]) && (s = (n < 3 ? r(s) : 3 < n ? r(e, o, s) : r(e, o)) || s);
    return 3 < n && s && Object.defineProperty(e, o, s), s;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameConfig"), s = e("AudioManager"), c = e("LoadManager"), l = e("PrefabView"), d = cc._decorator, u = d.ccclass, p = d.property, h = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.sprite = null, t.progressSprite = null, t.light = null, t.skeleton = null, 
        t.isEffect = !1, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        this.updateLight();
    }, t.prototype.start = function() {
        c.default.getInstance().loadSpriteFrame({
            url: "image/arm_draw/" + r.GC.maxDrawGunIdx,
            sprite: this.sprite
        }), this.sprite.node.scale = 0, cc.tween(this.sprite.node).to(.25, {
            scale: 2.2
        }).to(.2, {
            scale: 2
        }).start(), s.default.getInstance().playAudio("合成过程音效替换"), this.doEffect(), this.scheduleOnce(this.hidePnl, 2.5);
    }, t.prototype.doEffect = function() {
        this.isEffect = !0;
    }, t.prototype.updateLight = function() {
        var t = 360 * (this.progressSprite.fillStart + this.progressSprite.fillRange), e = cc.misc.degreesToRadians(t), t = Math.sin(e), e = Math.cos(e);
        this.light.setPosition(cc.v2(217 * e + this.progressSprite.node.x, 217 * t + this.progressSprite.node.y - 93));
    }, t.prototype.update = function(t) {
        var e = this;
        this.isEffect && (-.97 < this.progressSprite.fillRange ? (this.progressSprite.fillRange -= t / 2, 
        this.updateLight()) : (this.isEffect = !1, s.default.getInstance().playAudio("成功音效"), 
        this.skeleton.setAnimation(0, "animation1", !1), this.skeleton.setCompleteListener(function() {
            e.skeleton.setCompleteListener(null), e.skeleton.setAnimation(0, "animation2", !0);
        })));
    }, a([ p(cc.Sprite) ], t.prototype, "sprite", void 0), a([ p(cc.Sprite) ], t.prototype, "progressSprite", void 0), 
    a([ p(cc.Node) ], t.prototype, "light", void 0), a([ p(sp.Skeleton) ], t.prototype, "skeleton", void 0), 
    a([ u ], t);
}(l.default);

n.default = h;